package com.aodesoft.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.directwebremoting.annotations.DataTransferObject;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * DemoSns entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "DemoSNS")
@DataTransferObject
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class DemoSns implements java.io.Serializable {

	// Fields

	private Integer id;
	private String title;
	private String content;
	private Set<DemoReplay> demoReplaies = new HashSet<DemoReplay>(0);

	// Constructors

	public DemoSns() {
	}

	/** minimal constructor */
	public DemoSns(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public DemoSns(Integer id, String title, String content,
			Set<DemoReplay> demoReplaies) {
		this.id = id;
		this.title = title;
		this.content = content;
		this.demoReplaies = demoReplaies;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "title")
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "content")
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "demoSns")
	public Set<DemoReplay> getDemoReplaies() {
		return this.demoReplaies;
	}

	public void setDemoReplaies(Set<DemoReplay> demoReplaies) {
		this.demoReplaies = demoReplaies;
	}

}